package com.pp.common.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.*;
import lombok.experimental.Accessors;
import lombok.experimental.SuperBuilder;

import javax.validation.constraints.NotBlank;

@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@TableName("post")
public class Post extends BasePojo {

    /**
     * 帖子 ID
     */
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private String id;

    /**
     * 发帖人 ID
     */
    @TableField("user_id")
    private String userId;

    /**
     * 帖子标题
     */
    @NotBlank(message = "帖子标题不能为空")
    @TableField("title")
    private String title;

    /**
     * 帖子内容
     */
    @NotBlank(message = "帖子内容不能为空")
    @TableField("content")
    private String content;

    /**
     * 图片路径
     */
    @TableField("picture_path")
    private String picturePath;

    /**
     * 视频路径
     */
    @TableField("video_path")
    private String videoPath;

    /**
     * 帖子点赞数
     */
    @Builder.Default
    @TableField("post_like_num")
    private Integer postLikePost = 0;

    /**
     * 帖子浏览量
     */
    @Builder.Default
    @TableField("view_num")
    private Integer viewNum = 0;

    /**
     * 帖子评论量
     */
    @Builder.Default
    @TableField("comment_num")
    private Integer commentNum = 0;

    /**
     * 帖子转发量
     */
    @Builder.Default
    @TableField("forwarding_num")
    private Integer forwardingNum = 0;

    /**
     * 帖子被举报量
     */
    @Builder.Default
    @TableField("post_report_num")
    private Integer postReportNum = 0;

    /**
     * 帖子是否置顶
     */
    @Builder.Default
    @TableField("post_is_pinned")
    private Boolean postIsPinned = false;

    /**
     * 帖子状态: 0 - 禁用 1 - 启用 (默认启用)
     */
    @Builder.Default
    @TableField("post_status")
    private Boolean postStatus = true;

}
